﻿<%@ Page Title="文章管理" Language="C#" MasterPageFile="~/Admin/ListPage.master" AutoEventWireup="true" CodeFile="Details.aspx.cs" Inherits="NewsPub_Details" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="C">
    
 <div class="tools_box">
            <div class="tools_bar">
                <div class="search_box">
                    关键字：<asp:TextBox ID="txtKey" runat="server" CssClass="txtInput"></asp:TextBox>
                    <asp:Button ID="btnSearch" runat="server" Text="搜 索" CssClass="btnSearch" />
                </div>
                <a href="DetailsForm.aspx" class="tools_btn"><span><b class="add">添加文章</b></span></a>   
                <%--<a href="**.aspx" class="tools_btn"><span><b class="return">**管理</b></span></a>
                 <asp:LinkButton ID="btnEnable" runat="server" CssClass="tools_btn"
                    OnClientClick="return confirm('确定批量启用吗？')" OnClick="btnEnable_Click"><span><b class="error">批量启用</b></span></asp:LinkButton>
                 <asp:LinkButton ID="btnDisable" runat="server" CssClass="tools_btn"
                    OnClientClick="return confirm('确定批量禁用吗？')" OnClick="btnDisable_Click"><span><b class="delete">批量禁用</b></span></asp:LinkButton>
                <asp:LinkButton ID="btnDelete" runat="server" CssClass="tools_btn"
                    OnClientClick="return confirm('确定批量删除吗？')" OnClick="btnDelete_Click"><span><b class="delete">批量删除</b></span></asp:LinkButton>--%>		
            </div>
    </div>

    <asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="ods" AllowPaging="True" AllowSorting="false" CssClass="msgtable" PageSize="20" CellPadding="0" GridLines="None" EnableModelValidation="True">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:CheckBox ID="cb" runat="server" />
                </ItemTemplate>
                <HeaderStyle Width="20px" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:BoundField DataField="ID" HeaderText="编号" SortExpression="ID" InsertVisible="False" ReadOnly="True" >
			    <HeaderStyle Width="40px" HorizontalAlign="Center"/>
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" CssClass="key" />
            </asp:BoundField>
            <%--<asp:BoundField DataField="ClassisID" HeaderText="文章分类" SortExpression="ClassisID" >
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" CssClass="key" />
				<HeaderStyle HorizontalAlign="Center" />
            </asp:BoundField>--%>
            <asp:BoundField DataField="ClassisName" HeaderText="文章分类" SortExpression="ClassisID">
			<ItemStyle VerticalAlign="Middle" HorizontalAlign="Center" />
			<HeaderStyle HorizontalAlign="Center" />
			</asp:BoundField>			
                        <asp:BoundField DataField="Title" HeaderText="新闻标题" SortExpression="Title" />
            <asp:BoundField DataField="UserName" HeaderText="作者" SortExpression="UserID" DataFormatString="{0:n0}">
                <ItemStyle HorizontalAlign="Right" Font-Bold="True" />
				 <HeaderStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="CreateTime" HeaderText="发表时间" SortExpression="CreateTime" DataFormatString="{0:yyyy-MM-dd}" >
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" />
				<HeaderStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="EditTime" HeaderText="编辑时间" SortExpression="EditTime" DataFormatString="{0:yyyy-MM-dd}" >
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" />
				<HeaderStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <%--<asp:BoundField DataField="Hits" HeaderText="点击数" SortExpression="Hits" DataFormatString="{0:n0}">
                <ItemStyle HorizontalAlign="Right" Font-Bold="True" />
				 <HeaderStyle HorizontalAlign="Center" />
            </asp:BoundField>		--%>	
			 <asp:TemplateField HeaderText="编辑">
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperManager" runat="server" 						NavigateUrl='<%#"DetailsForm.aspx?ID="+Eval("ID")%>'	
                        Text='编辑'></asp:HyperLink>
                    </ItemTemplate>
					    <ItemStyle VerticalAlign="Middle" HorizontalAlign="Center" />            
                </asp:TemplateField>
			
			 <asp:TemplateField HeaderText="删除" ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="btnDelete" runat="server" CausesValidation="False" CommandName="Delete"
                            OnClientClick="return confirm('确定删除？');" Text="删除"></asp:LinkButton>
                    </ItemTemplate>                   
					<ItemStyle VerticalAlign="Middle" HorizontalAlign="Center" />
					<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"/>
                </asp:TemplateField>
			
        </Columns>
        <EmptyDataTemplate>
            没有符合条件的数据！
        </EmptyDataTemplate>
    </asp:GridView>
    <asp:ObjectDataSource ID="ods" runat="server" EnablePaging="True" SelectCountMethod="SearchCount" SelectMethod="Search" SortParameterName="orderClause" EnableViewState="false">
        <SelectParameters>
            <asp:ControlParameter ControlID="txtKey" Name="key" PropertyName="Text" Type="String" />
            <asp:Parameter Name="orderClause" Type="String" />
            <asp:Parameter Name="startRowIndex" Type="Int32" />
            <asp:Parameter Name="maximumRows" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <XCL:GridViewExtender ID="gvExt" runat="server">
    </XCL:GridViewExtender>
</asp:Content>